using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._TriangulatedSurface
{
    /// <summary>
    /// <para>Locate Outliers</para>
    /// <para>Identifies anomalous elevation measurements from terrain, TIN, or LAS datasets that exceed a defined range of elevation values or have slope characteristics that are inconsistent with the surrounding surface.</para>
    /// <para>识别来自地形、TIN 或 LAS 数据集的异常高程测量值，这些测量值超出了定义的高程值范围，或者坡度特征与周围表面不一致。</para>
    /// </summary>    
    [DisplayName("Locate Outliers")]
    public class LocateOutliers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LocateOutliers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_surface">
        /// <para>Input  Surface</para>
        /// <para>The terrain, TIN, or LAS dataset that will be analyzed.</para>
        /// <para>将要分析的 terrain、TIN 或 LAS 数据集。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// </param>
        public LocateOutliers(object _in_surface, object _out_feature_class)
        {
            this._in_surface = _in_surface;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Locate Outliers";

        public override string CallName => "3d.LocateOutliers";

        public override List<string> AcceptEnvironments => ["XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_surface, _out_feature_class, _apply_hard_limit.GetGPValue(), _absolute_z_min, _absolute_z_max, _apply_comparison_filter.GetGPValue(), _z_tolerance, _slope_tolerance, _exceed_tolerance_ratio, _outlier_cap];

        /// <summary>
        /// <para>Input  Surface</para>
        /// <para>The terrain, TIN, or LAS dataset that will be analyzed.</para>
        /// <para>将要分析的 terrain、TIN 或 LAS 数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input  Surface")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_surface { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Apply Hard Limit</para>
        /// <para><xdoc>
        ///   <para>Specifies use of absolute z minimum and maximum to find outliers.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not use the absolute z minimum and maximum to find outliers. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Use the absolute z minimum and maximum to find outliers.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定使用绝对 z 最小值和最大值来查找异常值。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不使用绝对 z 最小值和最大值来查找异常值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 使用绝对 z 最小值和最大值查找异常值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apply Hard Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _apply_hard_limit_value _apply_hard_limit { get; set; } = _apply_hard_limit_value._false;

        public enum _apply_hard_limit_value
        {
            /// <summary>
            /// <para>APPLY_HARD_LIMIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("APPLY_HARD_LIMIT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_APPLY_HARD_LIMIT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_APPLY_HARD_LIMIT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Absolute Z Minimum</para>
        /// <para>If hard limits are applied, any point with an elevation below this value will be considered an outlier. The default is 0.</para>
        /// <para>如果应用硬性限制，则高程低于此值的任何点都将被视为异常值。默认值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Absolute Z Minimum")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _absolute_z_min { get; set; } = 0;


        /// <summary>
        /// <para>Absolute Z Maximum</para>
        /// <para>If hard limits are applied, any point with an elevation above this value will be considered an outlier. The default is 0.</para>
        /// <para>如果应用硬限制，则高程高于此值的任何点都将被视为异常值。默认值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Absolute Z Maximum")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _absolute_z_max { get; set; } = 0;


        /// <summary>
        /// <para>Apply Comparison Filter</para>
        /// <para><xdoc>
        ///   <para>The comparison filter consists of three parameters for determining outliers: Z Tolerance, Slope Tolerance, and Exceed Tolerance Ratio.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not use the three comparison parameters (Z Tolerance, Slope Tolerance, and Exceed Tolerance Ratio) in assessing points.</bullet_item><para/>
        ///     <bullet_item>Checked—Use the three comparison parameters (Z Tolerance, Slope Tolerance, and Exceed Tolerance Ratio) in assessing points. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>比较过滤器由三个用于确定异常值的参数组成：Z 公差、斜率公差和超出公差比。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 在评估点时不要使用三个比较参数（Z 公差、斜率公差和超出公差比）。</bullet_item><para/>
        ///     <bullet_item>选中 - 在评估点时使用三个比较参数（Z 公差、斜率公差和超出公差比）。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Apply Comparison Filter")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _apply_comparison_filter_value _apply_comparison_filter { get; set; } = _apply_comparison_filter_value._true;

        public enum _apply_comparison_filter_value
        {
            /// <summary>
            /// <para>APPLY_COMPARISON_FILTER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("APPLY_COMPARISON_FILTER")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_APPLY_COMPARISON_FILTER</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_APPLY_COMPARISON_FILTER")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Z Tolerance</para>
        /// <para>Compares z-values of neighboring points if the comparison filter is applied. The default is 0.</para>
        /// <para>如果应用了比较过滤器，则比较相邻点的 z 值。默认值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _z_tolerance { get; set; } = 0;


        /// <summary>
        /// <para>Slope Tolerance</para>
        /// <para>The threshold of slope variance between consecutive points that will be used to identify outlier points. Slope is expressed as a percentage, with the default being 150.</para>
        /// <para>将用于识别异常值点的连续点之间的斜率方差阈值。斜率以百分比表示，默认值为 150。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Slope Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _slope_tolerance { get; set; } = 150;


        /// <summary>
        /// <para>Exceed Tolerance Ratio</para>
        /// <para>Defines the criteria for determining each outlier point as a function of the ratio of points in its natural neighborhood that must exceed the specified comparison filters. For example, the default value of 0.5 means at least half of the points surrounding the query point must exceed the comparison filters for the query point to be considered an outlier. A value of 0.7 means at least 70 percent of the neighbor points must exceed the tolerances.</para>
        /// <para>将确定每个异常值点的条件定义为其自然邻域中必须超过指定比较过滤器的点比率的函数。例如，默认值 0.5 表示查询点周围的至少一半点必须超过比较筛选器，查询点才能被视为异常值。值为 0.7 表示至少 70% 的相邻点必须超过容差。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Exceed Tolerance Ratio")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _exceed_tolerance_ratio { get; set; } = 0.5;


        /// <summary>
        /// <para>Outlier Cap</para>
        /// <para>The maximum number of outlier points that can be written to the output. Once this value is reached, no further outliers are sought. The default is 2,500.</para>
        /// <para>可以写入输出的最大异常值点数。一旦达到此值，就不会再寻找异常值。默认值为 2,500。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Outlier Cap")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _outlier_cap { get; set; } = 2500;


        public LocateOutliers SetEnv(object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}